using UnityEngine;

namespace BToolkit
{
    public class LabaDemo : MonoBehaviour
    {
        public LabaDriver laba;
        int totalCount = 20;

        private void Awake()
        {
            laba.SetCellUpdateCallback(totalCount, (LabaDemoCell cell, int index, bool isInit) =>
            {
                cell.text.text = index.ToString();
                if (!isInit)
                {
                //播放机械“哒哒”音效
            }
            });
        }

        void Update()
        {
            if (Input.GetMouseButtonUp(0))
            {
                int stopIndex = Random.Range(0, totalCount);
                Debug.Log($"将停在索引：{stopIndex}");
                laba.StartRun(stopIndex, (LabaDemoCell cell, int index) =>
                {

                });
            }
        }
    }
}